home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
WOW! 2
/
WOW - Vol 2.iso
/
pd_share
/
dfue
/
ka9qst
/
ka9q_src
/
arpdump.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-10-16
|
752b
|
39 lines
#include <stdio.h>
#include "global.h"
#include "mbuf.h"
#include "timer.h"
#include "arp.h"
arp_dump(bpp)
struct mbuf **bpp;
{
struct arp arp;
char *inet_ntoa();
if(bpp == NULLBUFP || *bpp == NULLBUF)
return;
printf("ARP: len %d",len_mbuf(*bpp));
if(ntoharp(&arp,bpp) == -1){
printf(" bad packet\n");
return;
}
if(arp.hardware < NHWTYPES)
printf(" hwtype %s",arptypes[arp.hardware]);
else
printf(" hwtype %u",arp.hardware);
printf(" prot 0x%x hwlen %u prlen %u",
arp.protocol,arp.hwalen,arp.pralen);
switch(arp.opcode){
case ARP_REQUEST:
printf(" op REQUEST");
break;
case ARP_REPLY:
printf(" op REPLY");
break;
default:
printf(" op %u",arp.opcode);
break;
}
printf(" target %s\n",inet_ntoa(arp.tprotaddr));
}